[HVM] Save/restore: catch more error cases in the tools
authorTim Deegan <Tim.Deegan@xensource.com>
Thu, 12 Apr 2007 14:54:59 +0000 (15:54 +0100)
committerTim Deegan <Tim.Deegan@xensource.com>
Thu, 12 Apr 2007 14:54:59 +0000 (15:54 +0100)
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
tools/libxc/xc_domain_restore.c

index 1b52c90e5b6caf0bea86a8877c884f418606ae2c..aaabed6d4241c0bb694fe97f657696b331f184b1 100644 (file)
@@ -688,12 +688,21 @@ int xc_domain_restore(int xc_handle, int io_fd, uint32_t dom,
             ERROR("error zeroing magic pages");
             goto out;
         }
-        
-        xc_set_hvm_param(xc_handle, dom, HVM_PARAM_IOREQ_PFN, magic_pfns[0]);
-        xc_set_hvm_param(xc_handle, dom, HVM_PARAM_BUFIOREQ_PFN, magic_pfns[1]);
-        xc_set_hvm_param(xc_handle, dom, HVM_PARAM_STORE_PFN, magic_pfns[2]);
-        xc_set_hvm_param(xc_handle, dom, HVM_PARAM_PAE_ENABLED, pae);
-        xc_set_hvm_param(xc_handle, dom, HVM_PARAM_STORE_EVTCHN, store_evtchn);
+                
+        if ( (rc = xc_set_hvm_param(xc_handle, dom, 
+                                    HVM_PARAM_IOREQ_PFN, magic_pfns[0]))
+             || (rc = xc_set_hvm_param(xc_handle, dom, 
+                                       HVM_PARAM_BUFIOREQ_PFN, magic_pfns[1]))
+             || (rc = xc_set_hvm_param(xc_handle, dom, 
+                                       HVM_PARAM_STORE_PFN, magic_pfns[2]))
+             || (rc = xc_set_hvm_param(xc_handle, dom, 
+                                       HVM_PARAM_PAE_ENABLED, pae))
+             || (rc = xc_set_hvm_param(xc_handle, dom, 
+                                       HVM_PARAM_STORE_EVTCHN, store_evtchn)) )
+        {
+            ERROR("error setting HVM params: %i", rc);
+            goto out;
+        }
         *store_mfn = magic_pfns[2];
 
         /* Read HVM context */